package com.hangan.langchainspringstart.controller;

import com.hangan.langchainspringstart.model.Volunteer;
import com.hangan.langchainspringstart.service.IVolunteerService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author hang an
 * @since 2025/8/1
 */
@RestController
@RequestMapping("/book")
@RequiredArgsConstructor
@Slf4j
public class BookController {
    private final IVolunteerService volunteerService;


    @PostMapping("/add")
    public Volunteer add(Volunteer volunteer) {
        return volunteerService.book(volunteer);
    }

    @GetMapping("/getByPhone")
    public Volunteer getByPhone(String phone) {

        return volunteerService.getByPhone(phone);
    }

}
